package com.haiheng.module_main.adapter.bookcar

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding
import com.haiheng.library_base.adapter.BaseAdapter
import com.haiheng.library_base.db.BookInfoBean
import com.haiheng.module_main.R
import com.haiheng.module_main.bean.req.BookInfoPageRes
import com.haiheng.module_main.bean.res.bookcar.BookCarBookResult
import com.haiheng.module_main.databinding.ItemBookCarListBinding

/**
 *
 * @Des:
 * @Author: hwz
 * @Date:2024/8/20 0020
 * @Version: 1.0
 */
class BookCarListAdapter:BaseAdapter<BookCarBookResult>() {

    init {
        addOnClickListener(R.id.ivDelete)
    }

    override fun onCreateViewBinding(viewType: Int): (LayoutInflater, ViewGroup, Boolean) -> ViewBinding {
        return ItemBookCarListBinding::inflate
    }

    override fun onItemView(holder: ViewBindHolder, position: Int, item: BookCarBookResult) {
        var binding = holder.binding as ItemBookCarListBinding
        binding.tvBarcode.text = item.barcode
        binding.tvBooknum.text = "${item.callNumber?:""}"
        binding.tvBookname.text = item.title

        addOnClickListener(binding.ivDelete.id)

    }



}